function addmaintain(e) {
    // 添加
    divset = document.getElementsByClassName("search");
    for (var i = 0; i<divset.length;i++) {
         divset[i].style.display="none";
    };
    divsetadd = document.getElementsByClassName("editmaintain");
    for (var i = 0; i<divset.length;i++) {
       divsetadd[i].style.display="inline";
    };
}
function backmaintain(e) {
   // 返回
   divset = document.getElementsByClassName("search");
   for (var i = 0; i<divset.length;i++) {
        divset[i].style.display="inline";
   };
   divsetedit = document.getElementsByClassName("addmaintain");
   for (var i = 0; i<divset.length;i++) {
       divsetedit[i].style.display="none";
   };
   divsetadd = document.getElementsByClassName("editmaintain");
   for (var i = 0; i<divset.length;i++) {
       divsetadd[i].style.display="none";
   };
}
function editmaintain(e) {
  // 编辑
  divset = document.getElementsByClassName("search");
  for (var i = 0; i<divset.length;i++) {
       divset[i].style.display="none";
  };
  divsetedit = document.getElementsByClassName("editmaintain");
  for (var i = 0; i<divset.length;i++) {
   divsetedit[i].style.display="inline";
  };
}
// 切换状态
function changeStata(e) {     
    var Img=document.getElementById('img');  
    $('#myModal').modal('hide');  
    if (Img.getAttribute("src",2) == '../../../images/success.png') {
        Img.setAttribute("src","../../../images/fail.png");
        $('#modal-input').html('确认启用');
    } else {                                   
        Img.setAttribute("src",'../../../images/success.png');
          //此处即为修改modal的标题
          $('#modal-input').html('确认停用');
    }
}